let keyword = ''
Page({
  data: {
    modalShow:false,//控制底部弹出层是否显示
    showList:[]
  },
  onSearch(event){
    this.setData({
      showList:[]
    })
    keyword = event.detail.keyword
    this._loadshowList()
  },
  onLoad: function (options) {
    this._loadshowList()
  },
  _loadshowList(start = 0){
    wx.showLoading({
      title: '拼命加载中',
    })
    wx.cloud.callFunction({
      name:'show',
      data:{
        keyword,
        start,
        count:10,
        $url:'list'
      }
    }).then(res=>{
      this.setData({
        showList:this.data.showList.concat(res.result)
      })
      wx.hideLoading()
      wx.stopPullDownRefresh()
    })
  },
  onPullDownRefresh:function(){
    this.setData({
      showList:[]
    })
    this._loadshowList(0)
  },
  onReachBottom:function(){
    this._loadshowList(this.data.showList.length)
  },
  
})